package com.sailorj.itools.utils;

import java.awt.Desktop;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;

/**
 * {@link Desktop}工具
 */
public interface DesktopUtil {
    Desktop DESKTOP = Desktop.getDesktop();

    /**
     * 跳转浏览器
     * @param url 访问url地址
     */
    static void browser(String url) {
        try {
            DESKTOP.browse(new URL(url).toURI());
        } catch (IOException | URISyntaxException e) {
            Logger.error(e.getMessage());
        }
    }
}

